#ifndef __syntax_base_H__
#define __syntax_base_H__

#include <string>
using namespace std;

namespace syntax_analysis
{
#define IN
#define OUT

	class parse_info;
	class parse_para;

	enum syntax_type
	{
		SYNTAX_CALL,
		SYNTAX_CHAR,
		SYNTAX_COMPOUND,
		SYNTAX_ENTRY,
	};

	class syntax
	{
	public:
		virtual syntax_type get_type() = 0;
		virtual string to_string() = 0;
	
		virtual bool parse( parse_info *info ) = 0;
		virtual bool reparse( parse_info *info ) = 0;
		virtual bool can_accept_more( parse_para *para ) = 0;
		virtual bool should_accept_more( parse_para *para ) = 0;

		void debug_info( parse_info * info );
	public:
		static void init_called();
		static void inc_called();
		static int get_called();
		static int m_called;
	};
	
}

#endif // __syntax_base_h__
